import request from '@/utils/request'

/***************************************************** 会员相关设置 ****************************************************/

/**
 * 获取登录设置
 */
export function getLoginConfig() {
  return request.get(`diy/config/member/login`)
}

/**
 * 注册登录设置
 * @param params
 * @returns
 */
export function setLoginConfig(params: Record<string, any>) {
  return request.post(`diy/config/member/login`, params, { showSuccessMessage: true })
}
/***************************************************** 会员标签 ****************************************************/

/**
 * 获取全部会员标签
 */
export function getMemberLabelAll() {
  return request.get(`member/label/all`)
}
/**
 * 获取全部会员等级
 */
export function getMemberLevelAll() {
  return request.get(`member/level/all`)
}
/**
 * 获取会员礼包字典
 * @returns
 */
export function getGiftDict() {
  return request.get(`member/dict/gift`)
}
/**
 * 获取会员礼包内容
 */
export function getMemberGiftsContent(params: Record<string, any>) {
  return request.post(`member/gifts/content`, params)
}
/**
 * 获取签到设置
 */
export function getSignConfig() {
  return request.get(`member/sign/config`)
}

/**
 * 设置签到设置
 * @param params
 * @returns
 */
export function setSignConfig(params: Record<string, any>) {
  return request.put(`member/sign/config`, params, { showSuccessMessage: true })
}

/**
 * 获取会员签到记录
 */
export function getMemberSignList(params: Record<string, any>) {
  return request.get(`member/sign`, { params })
}
